Integrand size = 20, antiderivative size = 56 \[ \int (c+d x) \sin (a+b x) \tan ^2(a+b x) \, dx=-\frac {d \text {arctanh}(\sin (a+b x))}{b^2}+\frac {(c+d x) \cos (a+b x)}{b}+\frac {(c+d x) \sec (a+b x)}{b}-\frac {d \sin (a+b x)}{b^2} \]
Time = 0.86 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.91 \[ \int (c+d x) \sin (a+b x) \tan ^2(a+b x) \, dx=\frac {\sec (a+b x) \left (3 b c+3 b d x+b (c+d x) \cos (2 (a+b x))+2 d \cos (a+b x) \left (\log \left (\cos \left (\frac {1}{2} (a+b x)\right )-\sin \left (\frac {1}{2} (a+b x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (a+b x)\right )+\sin \left (\frac {1}{2} (a+b x)\right )\right )\right )-d \sin (2 (a+b x))\right )}{2 b^2} \]
(Sec[a + b*x]*(3*b*c + 3*b*d*x + b*(c + d*x)*Cos[2*(a + b*x)] + 2*d*Cos[a + b*x]*(Log[Cos[(a + b*x)/2] - Sin[(a + b*x)/2]] - Log[Cos[(a + b*x)/2] + Sin[(a + b*x)/2]]) - d*Sin[2*(a + b*x)]))/(2*b^2)
Time = 0.45 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {4907, 3042, 3777, 3042, 3117, 4909, 3042, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (c+d x) \sin (a+b x) \tan ^2(a+b x) \, dx\) |
\(\Big \downarrow \) 4907 |
\(\displaystyle \int (c+d x) \sec (a+b x) \tan (a+b x)dx-\int (c+d x) \sin (a+b x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x) \sec (a+b x) \tan (a+b x)dx-\int (c+d x) \sin (a+b x)dx\) |
\(\Big \downarrow \) 3777 |
\(\displaystyle \int (c+d x) \sec (a+b x) \tan (a+b x)dx-\frac {d \int \cos (a+b x)dx}{b}+\frac {(c+d x) \cos (a+b x)}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (c+d x) \sec (a+b x) \tan (a+b x)dx-\frac {d \int \sin \left (a+b x+\frac {\pi }{2}\right )dx}{b}+\frac {(c+d x) \cos (a+b x)}{b}\) |
\(\Big \downarrow \) 3117 |
\(\displaystyle \int (c+d x) \sec (a+b x) \tan (a+b x)dx-\frac {d \sin (a+b x)}{b^2}+\frac {(c+d x) \cos (a+b x)}{b}\) |
\(\Big \downarrow \) 4909 |
\(\displaystyle -\frac {d \int \sec (a+b x)dx}{b}-\frac {d \sin (a+b x)}{b^2}+\frac {(c+d x) \cos (a+b x)}{b}+\frac {(c+d x) \sec (a+b x)}{b}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {d \int \csc \left (a+b x+\frac {\pi }{2}\right )dx}{b}-\frac {d \sin (a+b x)}{b^2}+\frac {(c+d x) \cos (a+b x)}{b}+\frac {(c+d x) \sec (a+b x)}{b}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle -\frac {d \text {arctanh}(\sin (a+b x))}{b^2}-\frac {d \sin (a+b x)}{b^2}+\frac {(c+d x) \cos (a+b x)}{b}+\frac {(c+d x) \sec (a+b x)}{b}\) |
-((d*ArcTanh[Sin[a + b*x]])/b^2) + ((c + d*x)*Cos[a + b*x])/b + ((c + d*x) *Sec[a + b*x])/b - (d*Sin[a + b*x])/b^2
3.3.62.3.1 Defintions of rubi rules used
Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]
Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[( -(c + d*x)^m)*(Cos[e + f*x]/f), x] + Simp[d*(m/f) Int[(c + d*x)^(m - 1)*C os[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[((c_.) + (d_.)*(x_))^(m_.)*Sin[(a_.) + (b_.)*(x_)]^(n_.)*Tan[(a_.) + (b _.)*(x_)]^(p_.), x_Symbol] :> -Int[(c + d*x)^m*Sin[a + b*x]^n*Tan[a + b*x]^ (p - 2), x] + Int[(c + d*x)^m*Sin[a + b*x]^(n - 2)*Tan[a + b*x]^p, x] /; Fr eeQ[{a, b, c, d, m}, x] && IGtQ[n, 0] && IGtQ[p, 0]
Int[((c_.) + (d_.)*(x_))^(m_.)*Sec[(a_.) + (b_.)*(x_)]^(n_.)*Tan[(a_.) + (b _.)*(x_)]^(p_.), x_Symbol] :> Simp[(c + d*x)^m*(Sec[a + b*x]^n/(b*n)), x] - Simp[d*(m/(b*n)) Int[(c + d*x)^(m - 1)*Sec[a + b*x]^n, x], x] /; FreeQ[{ a, b, c, d, n}, x] && EqQ[p, 1] && GtQ[m, 0]
Result contains complex when optimal does not.
Time = 1.58 (sec) , antiderivative size = 123, normalized size of antiderivative = 2.20
method | result | size |
risch | \(\frac {\left (d x b +c b +i d \right ) {\mathrm e}^{i \left (x b +a \right )}}{2 b^{2}}+\frac {\left (d x b +c b -i d \right ) {\mathrm e}^{-i \left (x b +a \right )}}{2 b^{2}}+\frac {2 \,{\mathrm e}^{i \left (x b +a \right )} \left (d x +c \right )}{b \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}+\frac {d \ln \left ({\mathrm e}^{i \left (x b +a \right )}-i\right )}{b^{2}}-\frac {d \ln \left (i+{\mathrm e}^{i \left (x b +a \right )}\right )}{b^{2}}\) | \(123\) |
1/2*(d*x*b+c*b+I*d)/b^2*exp(I*(b*x+a))+1/2*(d*x*b+c*b-I*d)/b^2*exp(-I*(b*x +a))+2*exp(I*(b*x+a))*(d*x+c)/b/(exp(2*I*(b*x+a))+1)+d/b^2*ln(exp(I*(b*x+a ))-I)-d/b^2*ln(I+exp(I*(b*x+a)))
Time = 0.26 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.66 \[ \int (c+d x) \sin (a+b x) \tan ^2(a+b x) \, dx=\frac {2 \, b d x + 2 \, {\left (b d x + b c\right )} \cos \left (b x + a\right )^{2} - d \cos \left (b x + a\right ) \log \left (\sin \left (b x + a\right ) + 1\right ) + d \cos \left (b x + a\right ) \log \left (-\sin \left (b x + a\right ) + 1\right ) - 2 \, d \cos \left (b x + a\right ) \sin \left (b x + a\right ) + 2 \, b c}{2 \, b^{2} \cos \left (b x + a\right )} \]
1/2*(2*b*d*x + 2*(b*d*x + b*c)*cos(b*x + a)^2 - d*cos(b*x + a)*log(sin(b*x + a) + 1) + d*cos(b*x + a)*log(-sin(b*x + a) + 1) - 2*d*cos(b*x + a)*sin( b*x + a) + 2*b*c)/(b^2*cos(b*x + a))
\[ \int (c+d x) \sin (a+b x) \tan ^2(a+b x) \, dx=\int \left (c + d x\right ) \sin {\left (a + b x \right )} \tan ^{2}{\left (a + b x \right )}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 2123 vs. \(2 (56) = 112\).
Time = 0.32 (sec) , antiderivative size = 2123, normalized size of antiderivative = 37.91 \[ \int (c+d x) \sin (a+b x) \tan ^2(a+b x) \, dx=\text {Too large to display} \]
1/2*(2*c*(1/cos(b*x + a) + cos(b*x + a)) - 2*a*d*(1/cos(b*x + a) + cos(b*x + a))/b + ((b*x + (b*x + a)*cos(2*b*x + 2*a) + a + sin(2*b*x + 2*a))*cos( 3*b*x + 3*a)^3 + 6*(b*x + a)*cos(b*x + a)^3 + ((b*x + a)*sin(2*b*x + 2*a) - cos(2*b*x + 2*a) - 1)*sin(3*b*x + 3*a)^3 + 6*(b*x + a)*cos(b*x + a)*sin( b*x + a)^2 + 2*(4*(b*x + a)*cos(2*b*x + 2*a)*cos(b*x + a) + 4*(b*x + a)*co s(b*x + a) + (3*(b*x + a)*sin(b*x + a) + cos(b*x + a))*sin(2*b*x + 2*a))*c os(3*b*x + 3*a)^2 + ((b*x + a)*cos(b*x + a) - sin(b*x + a))*cos(2*b*x + 2* a)^2 + (8*(b*x + a)*sin(2*b*x + 2*a)*sin(b*x + a) + (b*x + (b*x + a)*cos(2 *b*x + 2*a) + a + sin(2*b*x + 2*a))*cos(3*b*x + 3*a) + 2*(3*(b*x + a)*cos( b*x + a) - sin(b*x + a))*cos(2*b*x + 2*a) + 6*(b*x + a)*cos(b*x + a) - 2*s in(b*x + a))*sin(3*b*x + 3*a)^2 + ((b*x + a)*cos(b*x + a) - sin(b*x + a))* sin(2*b*x + 2*a)^2 + ((b*x + a)*cos(2*b*x + 2*a)^2 + 13*(b*x + a)*cos(b*x + a)^2 + (b*x + a)*sin(2*b*x + 2*a)^2 + (b*x + a)*sin(b*x + a)^2 + b*x + ( 13*(b*x + a)*cos(b*x + a)^2 + (b*x + a)*sin(b*x + a)^2 + 2*b*x + 2*a)*cos( 2*b*x + 2*a) + (12*(b*x + a)*cos(b*x + a)*sin(b*x + a) + cos(b*x + a)^2 + sin(b*x + a)^2)*sin(2*b*x + 2*a) + a)*cos(3*b*x + 3*a) + 2*(3*(b*x + a)*co s(b*x + a)^3 + 3*(b*x + a)*cos(b*x + a)*sin(b*x + a)^2 + (b*x + a)*cos(b*x + a) - sin(b*x + a))*cos(2*b*x + 2*a) + (b*x + a)*cos(b*x + a) - ((cos(2* b*x + 2*a)^2 + sin(2*b*x + 2*a)^2 + 2*cos(2*b*x + 2*a) + 1)*cos(3*b*x + 3* a)^2 + (cos(b*x + a)^2 + sin(b*x + a)^2)*cos(2*b*x + 2*a)^2 + (cos(2*b*...
Leaf count of result is larger than twice the leaf count of optimal. 2330 vs. \(2 (56) = 112\).
Time = 1.11 (sec) , antiderivative size = 2330, normalized size of antiderivative = 41.61 \[ \int (c+d x) \sin (a+b x) \tan ^2(a+b x) \, dx=\text {Too large to display} \]
1/2*(4*b*d*x*tan(1/2*b*x)^4*tan(1/2*a)^4 + 4*b*c*tan(1/2*b*x)^4*tan(1/2*a) ^4 + d*log(2*(tan(1/2*b*x)^2*tan(1/2*a)^2 + 2*tan(1/2*b*x)^2*tan(1/2*a) + 2*tan(1/2*b*x)*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a)^2 - 2*tan(1/2*b* x) - 2*tan(1/2*a) + 1)/(tan(1/2*b*x)^2*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan (1/2*a)^2 + 1))*tan(1/2*b*x)^4*tan(1/2*a)^4 - d*log(2*(tan(1/2*b*x)^2*tan( 1/2*a)^2 - 2*tan(1/2*b*x)^2*tan(1/2*a) - 2*tan(1/2*b*x)*tan(1/2*a)^2 + tan (1/2*b*x)^2 + tan(1/2*a)^2 + 2*tan(1/2*b*x) + 2*tan(1/2*a) + 1)/(tan(1/2*b *x)^2*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a)^2 + 1))*tan(1/2*b*x)^4*ta n(1/2*a)^4 - 16*b*d*x*tan(1/2*b*x)^3*tan(1/2*a)^3 - 16*b*c*tan(1/2*b*x)^3* tan(1/2*a)^3 - 4*d*log(2*(tan(1/2*b*x)^2*tan(1/2*a)^2 + 2*tan(1/2*b*x)^2*t an(1/2*a) + 2*tan(1/2*b*x)*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a)^2 - 2*tan(1/2*b*x) - 2*tan(1/2*a) + 1)/(tan(1/2*b*x)^2*tan(1/2*a)^2 + tan(1/2* b*x)^2 + tan(1/2*a)^2 + 1))*tan(1/2*b*x)^3*tan(1/2*a)^3 + 4*d*log(2*(tan(1 /2*b*x)^2*tan(1/2*a)^2 - 2*tan(1/2*b*x)^2*tan(1/2*a) - 2*tan(1/2*b*x)*tan( 1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a)^2 + 2*tan(1/2*b*x) + 2*tan(1/2*a) + 1)/(tan(1/2*b*x)^2*tan(1/2*a)^2 + tan(1/2*b*x)^2 + tan(1/2*a)^2 + 1))*tan (1/2*b*x)^3*tan(1/2*a)^3 + 4*d*tan(1/2*b*x)^4*tan(1/2*a)^3 + 4*d*tan(1/2*b *x)^3*tan(1/2*a)^4 + 4*b*d*x*tan(1/2*b*x)^4 + 16*b*d*x*tan(1/2*b*x)^3*tan( 1/2*a) + 48*b*d*x*tan(1/2*b*x)^2*tan(1/2*a)^2 + 16*b*d*x*tan(1/2*b*x)*tan( 1/2*a)^3 + 4*b*d*x*tan(1/2*a)^4 + 4*b*c*tan(1/2*b*x)^4 - d*log(2*(tan(1...
Time = 1.53 (sec) , antiderivative size = 151, normalized size of antiderivative = 2.70 \[ \int (c+d x) \sin (a+b x) \tan ^2(a+b x) \, dx={\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,\left (\frac {b\,c+d\,1{}\mathrm {i}}{2\,b^2}+\frac {d\,x}{2\,b}\right )-{\mathrm {e}}^{-a\,1{}\mathrm {i}-b\,x\,1{}\mathrm {i}}\,\left (\frac {-b\,c+d\,1{}\mathrm {i}}{2\,b^2}-\frac {d\,x}{2\,b}\right )+\frac {d\,\ln \left ({\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}-\mathrm {i}\right )}{b^2}-\frac {d\,\ln \left ({\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}+1{}\mathrm {i}\right )}{b^2}+\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}+b\,x\,1{}\mathrm {i}}\,\left (c+d\,x\right )\,2{}\mathrm {i}}{b\,\left ({\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\,1{}\mathrm {i}+1{}\mathrm {i}\right )} \]